public class test1 {
    public static void Euclid(int m,int n){
        int m1 = m, n1 = n;
        int r = 0;
        if (m > 0 && n > 0){
            while(n != 0){
                r = m % n;
                m = n;
                n = r;
            }
        }
        else{
            System.out.println("请输入两个不为零的非负整数！");
            return;
        }
        System.out.println(m1+","+n1+"的最大公约数为"+m);
    }
    public static void main(String[] args) {
        Euclid(60,24);
        Euclid(50,16);
        Euclid(7,-10);
    }
}
